# the following variable has to be set for each installation
GLMINSTALLDIRECTORY=./glm_install
PYTHONHEADER=/usr/include/python2.6
PYTHONLIBRARY=/usr/lib/libpython2.6.so
TINYXMLLIBRARY=./extlib/libTinyXml.a
HEADERS=./include 

# common version
CC=g++
CFLAGS=-c -g -Wall `freetype-config --cflags` 

# library dependencies
LDFLAGS= -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio -lfreetype -lfreeimage $(PYTHONLIBRARY)
INCLUDEFLAGS= -I $(GLMINSTALLDIRECTORY) -I $(PYTHONHEADER) -I $(HEADERS) -I ./src/pythonCModule -I ./extinclude

SOURCESTIXML = extlib/tinystr.cpp  extlib/tinyxml.cpp  extlib/tinyxmlerror.cpp  extlib/tinyxmlparser.cpp
LIBTIXML = libTIXML.a
TIXMLOBJECTS=$(SOURCESTIXML:.cpp=.o)



# Little Miss Engine source files
SOURCESLME  = src/CollisionEngine.cpp  src/Image.cpp      	src/PythonModule.cpp
SOURCESLME += src/Entity.cpp           src/Interface.cpp  	src/Screen.cpp
SOURCESLME += src/Material.cpp   	   src/LME_Shader.cpp	src/CollisionEngine.cpp
SOURCESLME += src/FontManager.cpp      src/Node.cpp       	src/StaticObject.cpp
SOURCESLME += src/HeightMap.cpp        src/Object.cpp     	src/utils.cpp
SOURCESLME += src/HitBox.cpp           src/Particle.cpp	  	src/Interface.cpp 
SOURCESLME += src/Camera.cpp		   src/RenderBuffer.cpp src/ParticleProjectileEmitter.cpp
SOURCESLME += src/Light.cpp

OBJECTS=$(SOURCESLME:.cpp=.o)
LIBFILE=libLME.a

all: $(SOURCESLME) $(LIBTIXML) $(LIBFILE)

$(LIBFILE): $(OBJECTS)
	ar -cvq $(LIBFILE) $(OBJECTS)

$(LIBTIXML): $(TIXMLOBJECTS)
	ar -cvq $(LIBTIXML) $(TIXMLOBJECTS)

.cpp.o:
	$(CC) $(CFLAGS) $(INCLUDEFLAGS) $< -o $@

clean:
	rm $(LIBFILE)
	rm $(LIBTIXML)
	rm src/*.o
	rm extlib/*.o

